%{
    #include <stdio.h>
    #include "./y.tab.h"

    int yywrap (void) {
        return 1;
    }
%}

%%
"+" return ADD;
"-" return SUB;
"*" return MUL;
"/" return DIV;
"\n" return CR;
"(" return BL;
")" return BR;

(Q|q)(U|u)(I|i)(T|t) {
    printf ("bye\n");
    exit (0);
}

([1-9][0-9]*)|0|([0-9]+\.[0-9]+) {
    double temp;
    sscanf (yytext, "%lf", &temp);
    yylval.double_value = temp;
    return DOUBLE_LITERAL;
}

[ \t] ;
. {
    fprintf (stderr, "lexical error.\n");
    exit (1);
}
%%
